package com.allprs.hmcs.controller;

import com.allprs.common.core.controller.BaseController;
import com.allprs.common.core.domain.AjaxResult;
import com.allprs.common.core.page.TableDataInfo;
import com.allprs.hmcs.entity.EmergencyPlan;
import com.allprs.hmcs.entity.HyParking;
import com.allprs.hmcs.entity.Project;
import com.allprs.hmcs.pojo.reqBo.EmergencyPlanQueryBo;
import com.allprs.hmcs.pojo.reqBo.ParkingLotQueryBo;
import com.allprs.hmcs.service.IEmergencyPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wjf
 * @描述:
 * @date 2024年11月06日
 * @version: 1.0
 */

@RestController
@RequestMapping("/plan")
@Api(tags = "应急预案管理")
@Slf4j
public class EmergencyPlanController extends BaseController {

    @Resource
    private IEmergencyPlanService emergencyPlanService;


    @ApiOperation(value = "新增应急预案")
    @PostMapping("/addPlan")
    public AjaxResult addPlan(@RequestBody EmergencyPlan vo){

        return emergencyPlanService.addPlan(vo);
    }


    @ApiOperation(value = "查询应急预案列表(支持分页)")
    @GetMapping("/getList")
    public TableDataInfo getList(EmergencyPlanQueryBo queryBo){
        startPage();
        List<EmergencyPlan> list = emergencyPlanService.getList(queryBo);

        return getDataTable(list);
    }


    @ApiOperation(value = "查询应急预案详情")
    @GetMapping("/getInfo")
    public AjaxResult getInfo(String id){
        return emergencyPlanService.getInfo(id);
    }

    @ApiOperation(value = "修改应急预案")
    @PostMapping("/update")
    public AjaxResult update(EmergencyPlan vo){
        return emergencyPlanService.update(vo);
    }

    @ApiOperation(value = "删除应急预案")
    @PostMapping("/delete")
    public AjaxResult delete(String id){
        return emergencyPlanService.delete(id);
    }



}
